import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sainbainu/common/values/colors.dart';

class EasyRefreshUtil {
  EasyRefreshUtil() {
    EasyRefresh.defaultHeaderBuilder = () => ClassicHeader(
          dragText: '下拉刷新'.tr,
          armedText: '松开后刷新'.tr,
          readyText: '正在刷新...'.tr,
          processingText: '正在刷新...'.tr,
          processedText: '刷新完成'.tr,
          noMoreText: '没有更多了'.tr,
          failedText: '刷新失败了'.tr,
          messageText: '最后更新于 %T'.tr,
          hitOver: true,
          hapticFeedback: true,
          textStyle: const TextStyle(
            color: AppColors.unactive3,
            fontSize: 14,
          ),
          messageStyle: const TextStyle(
            color: AppColors.unactive3,
            fontSize: 14,
          ),
          iconTheme: const IconThemeData(
            color: AppColors.unactive3,
            size: 20,
          ),
          spacing: 10,
        );
    EasyRefresh.defaultFooterBuilder = () => ClassicFooter(
          dragText: '上拉加载更多'.tr,
          armedText: '松开后刷新'.tr,
          readyText: '正在加载...'.tr,
          processingText: '正在加载...'.tr,
          processedText: '刷新完成'.tr,
          noMoreText: '没有更多了'.tr,
          failedText: '刷新失败了'.tr,
          messageText: '最后更新于 %T'.tr,
          hitOver: true,
          infiniteHitOver: true,
          textStyle: const TextStyle(
            color: AppColors.unactive3,
            fontSize: 14,
          ),
          messageStyle: const TextStyle(
            color: AppColors.unactive3,
            fontSize: 14,
          ),
          iconTheme: const IconThemeData(
            color: AppColors.unactive3,
            size: 20,
          ),
          spacing: 10,
        );
  }
}
